package com.dd.stack.mybatisplus.pojo.DO.varify_explain_type;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.dd.stack.common.util.annotation.Explanation;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.time.LocalDateTime;

/**
 * @Author liuxianmeng
 * @CreateTime 2025/3/25 23:10
 * @Description 用户基本信息表 用于验证MySQL内置性能分析工具EXPLAIN得出的type列值
 *              -> 性能 system > const > eq_ref > ref > range > index > ALL
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@TableName(value = "explain_type_verification_user", autoResultMap = true)
@Explanation("用户基本信息表 用于验证MySQL内置性能分析工具EXPLAIN得出的type列值" +
        "-> 性能 system > const > eq_ref > ref > range > index > ALL")
public class ExplainTypeVerificationUserDO {
    @Explanation("用户唯一标识")
    @TableId(type = IdType.AUTO)
    private Long id;
    @Explanation("登录用户名（唯一）")
    private String username;
    @Explanation("用户邮箱")
    private String email;
    @Explanation("用户年龄")
    private Integer age;
    @Explanation("账户创建时间")
    private LocalDateTime createdAt;

    // 生成测试数据
    public ExplainTypeVerificationUserDO(String username, String email, int age) {
        this.username = username;
        this.email = email;
        this.age = age;
    }
}
